package com.hyh.ad.common.config;



import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 读取项目相关配置
 *
 * @author pd
 */
@Component
@ConfigurationProperties(prefix = "ad")
@Data
public class AdProperties {
    private String name;
    private String version;
    private int copyrightYear;
    private boolean demoEnabled;
    private String profile;
    private boolean addressEnabled;
    private String captchaType;

    // 文件上传路径
    public String getUploads() {
        return profile +  "uploads/";
    }

    // 获取头像上传路径
    public String getAvatar() {
        return profile + "avatar/";
    }

    // 获取下载路径
    public String getDownloadPath() {
        return profile + "download/";
    }
}
